package com.exchange.used.web.api;

import com.exchange.used.config.converters.LayuiResult;
import com.exchange.used.entity.List;
import com.exchange.used.service.ListServiceI;
import com.exchange.used.service.UserServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/list")
public class ListController {

    @Autowired
    UserServiceI userServiceI;
    @Autowired
    ListServiceI listServiceI;

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public LayuiResult add(@RequestBody List list){
        return listServiceI.saveList(list);
    }

    @RequestMapping(value = "/updateListNum/{value}/{listid}", method = RequestMethod.GET)
    public LayuiResult add(@PathVariable String value, @PathVariable String listid){
        return listServiceI.updateListNum(value, listid);
    }

}
